# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>

pkgbase=python-unicodecsv
pkgname=python2-unicodecsv
pkgver=0.14.1
pkgrel=4
pkgdesc="Python2's stdlib csv module is nice, but it doesn't support unicode. This module is a drop-in replacement which *does*."
arch=('any')
url="https://github.com/jdunck/python-unicodecsv"
license=('BSD')
depends=('python2')
makedepends=('python2-setuptools')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/jdunck/python-unicodecsv/archive/$pkgver.tar.gz")
sha512sums=('9135c0f3702d60d72b2544476feb9e924b8d592e06d21eca98cd10406de9ecca49bcde9e9bfa7baeb4358dddf86ad737e155355d8b927de5b93912201a8d87b0')

prepare() {
  sed -i 's/unittest2/unittest/' python-unicodecsv-$pkgver/{runtests.py,unicodecsv/test.py}
  sed -i '/unittest2/d' python-unicodecsv-$pkgver/setup.py
}

build() {
  cd python-unicodecsv-$pkgver
  python2 setup.py build
}

check() {
  cd python-unicodecsv-$pkgver
  python2 setup.py test
}

package_python2-unicodecsv() {
  cd python-unicodecsv-$pkgver
  python2 setup.py install --root="$pkgdir" --optimize=1
}

# vim:set ts=2 sw=2 et:
